import 'package:flutter/material.dart';

class OrderItemCase extends StatelessWidget {
  const OrderItemCase({super.key});
  @override
  Widget build(BuildContext context) {
    
    return  Container(
      padding: const EdgeInsets.all(10),
      child: Column(
        children: [
          //顶部订单信息
        const Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text('2024-08-15 21:49:48'),
            Text('待发货',
            style: TextStyle(color: Colors.orange),),
          ],
          
        ),
        const SizedBox(height: 10,),
        //订单商品信息 中间商品信息
        Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Image.network('https://yanxuan-item.nosdn.127.net/a09de222ed32efa8ffe359b1d5780574.jpg',
            width: 100,
            height: 100,
            fit: BoxFit.cover,
            ),

       const SizedBox(width: 10,),
         Expanded(
          flex: 1,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,

            children: [
          const Row(
            children: [
              Expanded(
                child: Text('茶水分离杯耐热隔热玻璃杯 茶水分离杯耐热隔热玻璃杯',
                style: TextStyle(fontSize: 16),
                maxLines: 2,
                overflow: TextOverflow.ellipsis,
                ),
              ),
              SizedBox(width: 10,),
              Text('x2')
               
            ],
          
          ),
          Container(
            margin: const EdgeInsets.symmetric(vertical: 5),
            padding: const EdgeInsets.symmetric(vertical: 2,horizontal: 5),
            decoration: BoxDecoration(
              color: Colors.blue,
              borderRadius: BorderRadius.circular(5),
            ),
            child: const Text('规格：白色240ml',
            style: TextStyle(color: Colors.white,fontSize: 12),),
          ),
          const Text('￥119.5',
          style: TextStyle(fontSize: 16,color: Colors.red),),
        ],))
          ],
        ),

        SizedBox(
          width: double.infinity,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.end,
            children: [
              const Text('共2件商品，合计：￥239.0'),
            const  SizedBox(height: 5,),
              Container(
                padding: const EdgeInsets.symmetric(
                  vertical: 5,
                  horizontal: 10,
                ),
                decoration: BoxDecoration(
                  //边框线
                border: Border.all(
                  color: Colors.blue,
                  width: 1
                ),
                //投影
                boxShadow: [
                  BoxShadow(
                    color: Colors.grey.withOpacity(0.5),
                    spreadRadius: 1,
                    blurRadius: 3,
                    offset: const Offset(0, 2), // 阴影方向
                  ),
                ],
                //渐变
                gradient: const LinearGradient(colors: [Colors.red,Colors.orange],
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter,
                ),
                  borderRadius: BorderRadius.circular(5),
                ),
               child: const Text('再次购买',
               style: TextStyle(color: Colors.white),),
              ),
            ],
          ),
        )
        ],
      ),
    );
  }
}
